import subprocess
from PySide6.QtWidgets import QApplication, QMainWindow
from pyui.mainwindow_ui import Ui_MainWindow
from dialogs.noise_dialog import NoiseDialog
from dialogs.ptc_dialog import PTCDialog
from dialogs.overscan_dialog import OverscanDialog
import sys
import os
import datetime

class MainWindow(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        self.noiseButton.clicked.connect(self.show_noise_dialog)
        self.ptcButton.clicked.connect(self.show_ptc_dialog)
        self.overscanButton.clicked.connect(self.show_overscan_dialog)

    def show_noise_dialog(self):
        dialog = NoiseDialog(self, log_widget=self.logTextEdit)
        dialog.exec()

    def show_ptc_dialog(self):
        dialog = PTCDialog(self, log_widget=self.logTextEdit)
        dialog.exec()

    def show_overscan_dialog(self):
        dialog = OverscanDialog(self, log_widget=self.logTextEdit)
        dialog.exec()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec())
